package com.eusun.design.factory;

public class ShapeFactory {
    private ShapeFactory() {
    }

    public static Shape create(ShapeEnum shapeEnum) {
        Shape shape = null;
        try {
            shape = (Shape) Class.forName(shapeEnum.getClsName()).newInstance();
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
            e.printStackTrace();
        }
        return shape;
    }
}
